package com.zh;

import com.zh.article.Drug;
import com.zh.article.Weapon;
import com.zh.creature.Creature;
import com.zh.creature.MonsterTiger;
import com.zh.creature.MonsterWolf;
import com.zh.creature.Person;

/**
 * @description:
 * @author: zhangHang
 * @date: Created in 2020/4/27 10:17
 * @version: 1.0
 * @modified By:
 */
public class Ui {
        //输出基本信息
        public static void displayStatus(Scene scene){
                System.out.println("-------------------------------");
                //输出现在的地况
                displayReachableRooms(scene.getPerson());

                System.out.println("己方阵容：");
                System.out.print(scene.getPerson().getId()+"("+scene.getPerson().getDescription()+")"+
                        ":"+scene.getPerson().getHpValue()+"; ");//主角的个人信息
                for (Person item: scene.getPersonSet().getPeople()
                     ) {
                        System.out.print(item.getId()+"("+item.getDescription()+")"+":"+item.getHpValue()+"; ");
                }//帮手的个人信息

                System.out.println();
                System.out.println("己方药品库：");
                for (Drug item:scene.getPerson().getDrugSet().getDrugs()
                ) {
                        System.out.println(item.getId()+"; "+item.getDescription()+"; 效果值："+item.getEffectPoints());
                }
                System.out.println("己方的武器库：");
                for (Weapon item: scene.getPerson().getWeaponSet().getWeapons()
                ) {
                        System.out.println(item.getId()+"; "+item.getDescription()+"; 伤害："+item.getDamagePoints());
                }

                displaySpecialSkill(scene.getPerson());//己方的特殊技能


                System.out.println("当前房间中的敌人：");
                for (MonsterWolf item:scene.getPerson().getCurrentRoom().getMonsterWolfSet().getMonsterWolves()
                ) {
                        System.out.print(item.getId()+"("+item.getDescription()+")"+":"+item.getHpValue()+" \n");
                }//狼的信息
                for (MonsterTiger item:scene.getPerson().getCurrentRoom().getMonsterTigerSet().getMonsterTigers()
                     ) {
                        System.out.print(item.getId()+"("+item.getDescription()+")"+":"+item.getHpValue()+" \n");
                }//老虎的信息

        }

        public static void displayHelpMsg(){
                System.out.println("********************                                                                                                   ******************");
                System.out.println("------go teaseNight, chopT、chopW( chopW wolf1, chopT tiger1), pickW rpw1, pickD rpd1, useD rpd1, useS sp1, equip rpw1, help, bye,-------");
                System.out.println("********************                                                                                                   ******************");
        }

        public static void displayBye(){
                System.out.println("You are a deserter!!!!!!!!");
        }

        public static void displayErrorCmdMsg(){
                System.out.println("您输入了非法命令。");
        }

        public static void printNoRoom(){
                System.out.println("没有这个房间");
        }

        public static void displayDamageMsg(Creature attackCreature, Creature targetCreature){
                System.out.println(attackCreature.getDescription()+"对"+targetCreature.getDescription()+
                        "照成"+attackCreature.getCurrentWeapon().getDamagePoints()+"伤害。");
        }

        public static void displaySpecialSkill(Creature creature){
                System.out.println("己方的特殊技能：");
                System.out.print(creature.getSpecialSkills().getDescription()+"  使用次数：");
                System.out.println(creature.getSpecialSkills().getFlag());
                System.out.println("-------------------------------");
        }

        public static void displayReachableRooms(Person person){
                System.out.println("现在你在：\n"+person.getCurrentRoom().getId()+"  "+person.getCurrentRoom().toString());
                System.out.println("出口有：");//输出地图信息
                for(String key:person.getCurrentRoom().getReachableRooms().keySet()){
                        System.out.print(key+"  "+person.getCurrentRoom().getReachableRooms().get(key)+"; ");
                }
                System.out.println();
        }

        public static void displayWeapons(Person person){

                System.out.println("当前房间的武器: ");
                for (Weapon item:person.getCurrentRoom().getWeaponSet().getWeapons()
                     ) {
                        System.out.println(item.getId()+"; "+item.getDescription()+"; 伤害："+item.getDamagePoints());
                }
        }

        public static void displayDrugs(Person person){
                System.out.println("当前房间的药品：");
                for (Drug item: person.getCurrentRoom().getDrugSet().getDrugs()
                     ) {
                        System.out.println(item.getId()+"; "+item.getDescription()+"; 效果值："+item.getEffectPoints());
                }
                System.out.println("-------------------------------");
        }
}
